//
//  addClassWithMessageView.m
//  SchoolTimetable
//
//  Created by 梦里都是梦 on 16/1/13.
//  Copyright © 2016年 Yuanlinqian. All rights reserved.
//

#import "addClassWithMessageView.h"

@implementation addClassWithMessageView
- (IBAction)cancelBtnPressed:(UIButton *)sender {
    [self moveToTop];
    
}
- (IBAction)sureBtnPressed:(UIButton *)sender {
    
    if (self.nameForClassTF.text.length != 0 && self.classroomForClassTF.text.length != 0 && self.teacherForClassTF.text.length != 0 ) {
        if (_SMBlock) {
            _SMBlock(self.nameForClassTF.text,self.teacherForClassTF.text,self.classroomForClassTF.text);
        }
           [self moveToTop];
        
    }
    else
    {   [SVProgressHUD showErrorWithStatus:@"课程信息不能为空"];
    }
}
-(void)moveToTop
{
    self.nameForClassTF.text = nil;
    self.teacherForClassTF.text = nil;
    self.classroomForClassTF.text = nil;
    [UIView animateWithDuration:1 animations:^{
        self.frame = CGRectMake((SCREEN_SIZE.width-200)/2, -200, 200, 140);
    }];
    

}
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
